﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- SimpleStyles: Expander -->
    <!-- Expander ToggleButton Style -->
    <ControlTemplate x:Key="ExpanderToggleButton" TargetType="{x:Type ToggleButton}">
        <Border
				Name="etbBorder"
				Background="#E0E0E0"
				BorderBrush="#404040"
				BorderThickness="3"
				CornerRadius="5">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Ellipse
						Width="30"
						Height="30"
						Grid.Row="0"
						Margin="2"
						Stroke="#FF747474"
						StrokeThickness="2"/>
                <Path
						Name="Arrow"
						Grid.Row="0"
						HorizontalAlignment="Center"
						VerticalAlignment="Center"
						Data="M 0,6 L 10,6 L 6,0 L 10,0 L 18,8 L 10,16 L 6,16 L 10,10 L 0,10 Z"
						Fill="#FF3C3C3C">
                    <Path.LayoutTransform>
                        <RotateTransform Angle="0"/>
                    </Path.LayoutTransform>
                </Path>
                <ContentControl Grid.Row="1" Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}}, Path=Header}">
                    <ContentControl.LayoutTransform>
                        <RotateTransform Angle="-90"/>
                    </ContentControl.LayoutTransform>
                </ContentControl>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                <Setter TargetName="etbBorder" Property="Background" Value="#D0D0D0"/>
                <Setter TargetName="etbBorder" Property="Opacity" Value="0.7"/>
                <Setter TargetName="Arrow" Property="Fill" Value="#FF0010AE"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="etbBorder" Property="Background" Value="#E0E0E0"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation
									Duration="0:0:0.4"
									Storyboard.TargetName="Arrow"
									Storyboard.TargetProperty="(Path.LayoutTransform).(RotateTransform.Angle)"
									To="180"/>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation
									Duration="0:0:0.4"
									Storyboard.TargetName="Arrow"
									Storyboard.TargetProperty="(ToggleButton.LayoutTransform).(RotateTransform.Angle)"
									To="0"/>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
                <Setter TargetName="etbBorder" Property="CornerRadius" Value="0,5,5,0"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!-- Expander Style -->
    <Style TargetType="{x:Type Expander}" x:Key="BEExpander">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border
							Background="#FF8F8F8F"
							BorderBrush="#FF8F8F8F"
							BorderThickness="8"
							CornerRadius="10">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Border
									Name="Content"
									Grid.Column="0"
									Background="#FFFFFF"
									Width="0"
									BorderBrush="#888888"
									BorderThickness="1,0,1,1"
									CornerRadius="5,0,0,5">
                                <ContentPresenter Margin="4"/>
                            </Border>
                            <ToggleButton
									Grid.Column="1"
									Background="#C0C0C0"
									IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
									OverridesDefaultStyle="True"
									Template="{StaticResource ExpanderToggleButton}"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="True">
                            <!-- <Setter TargetName="Content" Property="Width" Value="{Binding ElementName=Content,Path=DesiredWidth}"/> -->
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation
												Duration="0:0:0.4"
												Storyboard.TargetName="Content"
												Storyboard.TargetProperty="Width"
												To="250"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation
												Duration="0:0:0.4"
												Storyboard.TargetName="Content"
												Storyboard.TargetProperty="Width"
												To="0"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SimpleStyles: Button -->

    <Style TargetType="{x:Type Button}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border
                            x:Name="Border"
                            Padding="15,0,10,0"
                            CornerRadius="3" 
                            BorderThickness="3"
                            Background="#C0C0C0"
                            BorderBrush="#404040" >
                            <Border.RenderTransform>
                                <SkewTransform CenterY="13" AngleX="-45" />
                            </Border.RenderTransform>
                        </Border>
                        <ContentPresenter
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="#202020" />
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="#202020" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#808080" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#E0E0E0" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#606060" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                            <Setter Property="Foreground" Value="#888888"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>